#ifndef LENGTHFORMATER_H
#define LENGTHFORMATER_H

#include <ostream>


/////////////////////////////////////////////////////////////////////
class Formater 
{
    friend std::ostream& operator<<(std::ostream& os, const Formater& formater);

public:
    virtual format(std::ostream& os, int amoutInBase) = 0;
    virtual ~Formater();

protected:
    int amoutInBase;
    std::ostream os;
};

/////////////////////////////////////////////////////////////////////
class SequenceUnitFormater : public Formater : public UnitVisitor
{
public:
    SequenceUnitFormater(int amoutInBase);
    void format(std::ostream& os) ;
    void visit(const Unit& unit);
};

/////////////////////////////////////////////////////////////////////
class BaseUnitFormater : public Formater
{
public:
    BaseUnitFormater(int amoutInBase, const Unit& baseUnit);
    void format(std::ostream& os) ;

private:
    const Unit& baseUnit;
};


#endif
